<!-- 实现一个计数器 -->
<template>
    <div>
        <button @click="plus">+</button>
        <span> {{ count }} </span>
        <button @click="minus">-</button>
    </div>
</template>

<script>
    export default {
        // eslint-disable-next-line vue/multi-word-component-names
        name: 'Calc',
        // eslint-disable-next-line vue/multi-word-component-names
        data() {
            return { count: 0 }
        },
        methods: {
            plus: function() {
                this.count++
            },
            minus: function() {
                if (this.count === 0) {
                    return
                }
                this.count--
            }
        }
    }
</script>


<style>

</style>
